<!DOCTYPE html>
<html>
<head>
	<title></title>
</head>
<body>

<script type="text/javascript">

//ES7 方法
console.error("x".padStart(5, "ab"));
console.error("x".padEnd(4, "ab"));

console.error("xxx".padStart(2, "ab"));
console.error("xxx".padEnd(2, "ab"));

console.error("x".padStart(5));
console.error("x".padEnd(5));

</script>

</body>
</html>